<?php
$this->pageTitle = Yii::app()->name . ' - Add User To Project';

$this->breadcrumbs = array(
    //'Articles' => array('index'),
    //$model->id => array('view', 'id' => $model->id),
    $model->article->headline => array('view', 'id' => $model->article->id),
    'Add User',
);

$this->menu = array(
//    array('label' => 'List Article', 'url' => array('index')),
//    array('label' => 'Create Article', 'url' => array('create')),
//    array('label' => 'Update Article', 'url' => array('update', 'id'=> $model->id)),
//    array('label' => 'View Article', 'url' => array('view', 'id' => $model->id)),
//    array('label' => 'Manage Article', 'url' => array('admin')),
    array(
        'label'=>'Back To Article',
        'url'=>array('view', 'id'=>$model->article->id),
    ),
);
?>

<h1>Add User To <?php echo $model->article->headline ?></h1>


<?php if (Yii::app()->user->hasFlash('success')) : ?>
<div class="successMessage">
    <?php echo Yii::app()->user->getFlash('success'); ?>
</div>
<?php endif; ?>

<div class="form">
    <?php $form=$this->beginWidget('CActiveForm'); ?>
    <p class="note">
        Fields with <span class="required">*</span> are required.
    </p>

    <div class="row">
        <?php echo $form->labelEx($model, 'username'); ?>
        <?php
            $this->widget('CAutoComplete', array(
                'model'=>$model,
                'attribute'=>'username',
                'data'=> $usernames,
                'multiple'=>false,
                'htmlOptions' => array('size'=>25),
            ));
        ?>
        <?php echo $form->error($model, 'username'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'role'); ?>
        <?php echo $form->dropDownList($model, 'role', Article::getUserRoleOptions()); ?>
        <?php echo $form->error($model, 'role'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton('Add User'); ?>
    </div>

    <?php $this->endWidget(); ?>
</div>